<html>
<head>
<title> Customizing Web Server Error Messages </title>
<meta name="Keywords" content="" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="stylesheet.css"/>
<script src="locate.js"></script>
<link href="prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="prettify.js"></script>
</head>
<script src="highlight.js"></script>
<body bgcolor="#FFFFFF" text="#000000" link="#0000A0" alink="#008000" vlink="#FF0000" onLoad="FindCorrectTOCPage(); prettyPrint()">
<table cellpadding="0" cellspacing="0" border="0">
<tr valign="top">
<td>
<p class="pagenavigation"><a href="17310.htm" target="_self"><img src="38976.gif" alt="Previous page" height="16" width="16" vspace="0" hspace="1" align="top" border="0"> Previous page</a></p></td>
<td>
<p class="pagenavigation"><a href="17323.htm" target="_self"><img src="38977.gif" alt="Next page" height="16" width="16" vspace="0" hspace="1" align="top" border="0"> Next page</a></p></td>
<td>
<p class="pagenavigation"><a href="toc41518100.htm" target="TOC"><img src="38970.gif" alt="Locate page" height="16" width="16" vspace="0" hspace="1" align="top" border="0"> Locate page</a></p></td>
<td>
<p class="pagenavigation"><a href="toc41518100.htm" target="TOC"><a class="" title="" href="javascript:print();" target="_self"><img src="39072.gif" alt="Print this page" height="16" width="16" vspace="0" hspace="1" align="top" border="0"></a></a></p></td>
</tr>
</table>
<h3 class="heading3">Customizing Web Server Error Messages</h3>
<p class="bodytext">When visitors coming to a site request pages that the web server cannot find, the web server generates and displays a standard HTML page with an error message. The standard error messages may inform of problems, but they do not usually say how to resolve them or how to get the lost visitor on his way, and they also look dull.</p>
<p class="bodytext">You may want to create your own error pages and use them on your web server. With Plesk you can customize the following error messages:</p>
<ul class="listbullet"><li class="listbullet"><strong class="specialbold"><strong class="specialbold">400 Bad File Request.</strong></strong> Usually means the syntax used in the URL is incorrect (for example, uppercase letter should be lowercase letter; wrong punctuation marks).</li><li class="listbullet"><strong class="specialbold"><strong class="specialbold">401 Unauthorized.</strong></strong> Server is looking for some encryption key from the client and is not getting it. Also, wrong password may have been entered.</li><li class="listbullet"><strong class="specialbold"><strong class="specialbold">403 Forbidden/Access denied.</strong></strong> Similar to 401; a special permission is needed to access the site - a password and/or username if it is a registration issue.</li><li class="listbullet"><strong class="specialbold"><strong class="specialbold">404 Not Found.</strong></strong> Server cannot find the requested file. File has either been moved or deleted, or the wrong URL or document name was entered. This is the most common error.</li><li class="listbullet"><strong class="specialbold"><strong class="specialbold">405 Method Not Allowed.</strong></strong> The method specified in the Request-Line is not allowed for the resource identified by the Request-URI.</li><li class="listbullet"><strong class="specialbold"><strong class="specialbold">406 Not Acceptable.</strong></strong> The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request.</li><li class="listbullet"><strong class="specialbold"><strong class="specialbold">407 Proxy Authentication Required.</strong></strong> This code is similar to 401 (Unauthorized), but indicates that the client must first authenticate itself with the proxy. </li><li class="listbullet"><strong class="specialbold"><strong class="specialbold">412 Precondition Failed.</strong></strong> The precondition given in one or more of the request-header fields evaluated to false when it was tested on the server. This response code allows the client to place preconditions on the current resource metainformation (header field data) and thus prevent the requested method from being applied to a resource other than the one intended.</li><li class="listbullet"><strong class="specialbold"><strong class="specialbold">414 Request-URI Too Long.</strong></strong> The server is refusing to service the request because the Request-URI is longer than the server is willing to interpret. This rare condition is only likely to occur when a client has improperly converted a POST request to a GET request with long query information, when the client has descended into a URI &quot;black hole&quot; of redirection (e.g., a redirected URI prefix that points to a suffix of itself), or when the server is under attack by a client attempting to exploit security holes present in some servers using fixed-length buffers for reading or manipulating the Request-URI.</li><li class="listbullet"><strong class="specialbold"><strong class="specialbold">415 Unsupported Media Type.</strong></strong> The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method.</li><li class="listbullet"><strong class="specialbold"><strong class="specialbold">500 Internal Server Error.</strong></strong> Could not retrieve the HTML document because of server-configuration problems.</li><li class="listbullet"><strong class="specialbold"><strong class="specialbold">501 Not Implemented.</strong></strong> The server does not support the functionality required to fulfill the request. This is the appropriate response when the server does not recognize the request method and is not capable of supporting it for any resource.</li><li class="listbullet"><strong class="specialbold"><strong class="specialbold">502 Bad Gateway.</strong></strong> The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the request.</li></ul><p class="bodytext"></p>
<p class="procedureheading">To configure Plesk's web server to show custom error pages for a domain:</p>
<ol class="procedurelistnumber"><li class="procedurelistnumber">Switch on support for custom error documents through Plesk. <ol class="procedurelistnumber2"><li class="procedurelistnumber2">Click the <strong class="specialbold">Domains</strong> shortcut in the navigation pane.</li><li class="procedurelistnumber2">Click the required domain name in the list.</li><li class="procedurelistnumber2">Click <strong class="specialbold">Setup</strong>. </li><li class="procedurelistnumber2">Select the <strong class="specialbold">Custom Error Documents</strong> check box. </li><li class="procedurelistnumber2">Click <strong class="specialbold">OK</strong>.</li></ol></li><li class="procedurelistnumber">If you access Plesk remotely, connect to your FTP account on the Plesk server, and go to the <code class="monospace">error_docs</code> directory. If you access Plesk locally, go to the directory <code class="monospace">/vhosts/your-domain.com/error_docs/.</code></li><li class="procedurelistnumber">Edit or replace the respective files. Be sure to preserve the correct file names:<ul class="listbullet2"><li class="listbullet2">400 Bad File Request - <code class="monospace">bad_request.html</code></li><li class="listbullet2">401 Unauthorized - <code class="monospace">unauthorized.html</code></li><li class="listbullet2">403 Forbidden/Access denied - <code class="monospace">forbidden.html</code></li><li class="listbullet2">404 Not Found - <code class="monospace">not_found.html</code></li><li class="listbullet2">405 Method Not Allowed<code class="monospace"> - method_not_allowed.html</code></li><li class="listbullet2">406 Not Acceptable<code class="monospace"> - not_acceptable.html</code></li><li class="listbullet2">407 Proxy Authentication Required<code class="monospace"> - proxy_authentication_required.html</code></li><li class="listbullet2">412 Precondition Failed<code class="monospace"> - precondition_failed.html</code></li><li class="listbullet2">414 Request-URI Too Long<code class="monospace"> - request-uri_too_long.html</code></li><li class="listbullet2">415 Unsupported Media Type<code class="monospace"> - unsupported_media_type.html</code></li><li class="listbullet2">500 Internal Server Error - <code class="monospace">internal_server_error.html</code></li><li class="listbullet2">501 Not Implemented<code class="monospace"> - not_implemented.html</code></li><li class="listbullet2">502 Bad Gateway<code class="monospace"> - bad_gateway.html</code></li></ul></li><li class="procedurelistnumber">Restart your web server or wait for a few hours till your web server is restarted. After that, the web server will start using your error documents.</li></ol>


</body>
<script>highlightTOC()</script>
</html>

